﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DIS.Infrastructure.Entities.Repository;
using DIS.Infrastructure.Entities.Enum;
using DIS.Infrastructure.Entities.Cache;

namespace DIS.Infrastructure.Entities.Entity
{
    public class CityTaxiDetail : IAccessible<T_CityTaxiDetail, CityTaxiDetail>, ILogicEntity<T_CityTaxiDetail, CityTaxiDetail>
    {
        public int Id { get; set; }

        public int CityTaxiId { get; set; }

        public string ReconnaissanceDate { get; set; }

        public string TravelAddress { get; set; }

        public string ReconnaissanceName { get; set; }

        public decimal TaxiFee { get; set; }

        public int InvoiceCount { get; set; }

        public CityTaxi cityTaxi { get; set; }

        public CityTaxiDetail LoadCityTaxi(T_CityTaxi cityTaxi)
        {
            this.cityTaxi = new CityTaxi().Set(cityTaxi);
            return this;
        }

        public CityTaxiDetail LoadCityTaxi(T_CityTaxi cityTaxi,T_User user)
        {
            this.cityTaxi = new CityTaxi().Set(cityTaxi).LoadUser(user);
            return this;
        }

       

        protected override void Covariant(T_CityTaxiDetail model)
        {
            this.Id = model.Id;
            this.CityTaxiId = model.CityTaxiId;
            this.ReconnaissanceDate = model.ReconnaissanceDate;
            this.TravelAddress = model.TravelAddress;
            this.ReconnaissanceName = model.ReconnaissanceName;
            this.TaxiFee = model.TaxiFee;
            this.InvoiceCount = model.InvoiceCount;
        }
        protected override T_CityTaxiDetail Inverter(CityTaxiDetail model)
        {
            return new T_CityTaxiDetail()
            {
                Id = model.Id,
                CityTaxiId=model.CityTaxiId,
                ReconnaissanceDate = model.ReconnaissanceDate,
                TravelAddress = model.TravelAddress,
                ReconnaissanceName = model.ReconnaissanceName,
                TaxiFee = model.TaxiFee,
                InvoiceCount = model.InvoiceCount
            };
        }
        public CityTaxiDetail Set(T_CityTaxiDetail dbModel)
        {
            Covariant(dbModel);
            return this;
        }
    }
}
